package keys

import (
	"runtime"
	"time"

	"github.com/micmonay/keybd_event"
)

func ClipboardPaste() {
	kb, err := keybd_event.NewKeyBonding()
	defer func() {
		_ = kb.Release()
	}()

	if err != nil {
		panic(err)
	}

	if runtime.GOOS == "linux" {
		time.Sleep(2 * time.Second)
	}

	kb.SetKeys(keybd_event.VK_V)

	switch runtime.GOOS {
	case "darwin":
		kb.HasSuper(true)
	case "linux":
		kb.HasCTRL(true) //???
	case "windows":
		kb.HasCTRL(true)
	default:
		kb.HasCTRL(true)
	}

	_ = kb.Press()
}
